#include "stdafx.h"
#include "cppunit/extensions/HelperMacros.h"
#include "cppunit/extensions/TestFactoryRegistry.h"
#include <windows.h>
class TechTest : public CppUnit::TestFixture
{
public:
	CPPUNIT_TEST_SUITE(TechTest);
	CPPUNIT_TEST(FindProcessByModuleName);
	CPPUNIT_TEST(FindProcessByWindowHandler);
	CPPUNIT_TEST_SUITE_END();
protected:
	void FindProcessByModuleName();
	void FindProcessByWindowHandler();
};

CPPUNIT_TEST_SUITE_REGISTRATION(TechTest);

void TechTest::FindProcessByModuleName()
{

}

BOOL CALLBACK EnumUIWindowsProc (HWND hWnd, LPARAM lParam)
{
	int nItem = 0;

	//Make sure that the window is visible

	TCHAR szWindowText [MAX_PATH];
	if (!::IsWindowVisible (hWnd))
		return TRUE;

	//Get the text on the title bar

	::GetWindowText (hWnd, szWindowText, MAX_PATH);

	//If the window is Process Manager then don't display it

	if (_tcsstr (_T("Program Manager"), szWindowText))
		return TRUE;

	//Get process ID

	DWORD dwProcessID;
	GetWindowThreadProcessId (hWnd, &dwProcessID);
	//Add the info to the list control
	return TRUE;
}
void TechTest::FindProcessByWindowHandler()
{

}